#pragma once
#include <iostream>
#include <string>
/*描述日志等级类
日志等级:只有日志等级>=某个默认等级才输出
    Known=0,Debug,Info,Warning,Error,Fatal,Off
    对外提供转字符串接口
*/
namespace ns_logger
{
    class LogLevel
    {
    public:
        enum class value
        {
            Known = 0,
            Dubug,
            Info,
            Warning,
            Error,
            Fatal,
            Off
        };

        static std::string LevelToString(LogLevel::value level)
        {
            switch (level)
            {
            case LogLevel::value::Dubug:
                return "Dubug";
            case LogLevel::value::Info:
                return "Info";
            case LogLevel::value::Warning:
                return "Warning";
            case LogLevel::value::Error:
                return "Error";
            case LogLevel::value::Fatal:
                return "Fatal";
            default:
                return "Known";
            }
        }
    };
};
